Heejin Algorithm